package app

import (
	"iot/iot_app_server/app/device"
	"iot/iot_app_server/app/user"
	"net/http"
)

var cfg = struct {
	Log struct {
		File   string
		Level  string
		Name   string
		Suffix string
	}

	Prog struct {
		CPU        int
		Daemon     bool
		HealthPort string
	}

	Server struct {
		Redis    string
		Mysql    string
		PortInfo string
	}
}{}

//注册http回调
func RegisterHttpHandle() {
	//user
	http.HandleFunc("/user/get_device_list", user.HandleGetDeviceList)

	// device
	http.HandleFunc("/device/get_status", device.HandleGetDeviceStatus)
	http.HandleFunc("/device/control", device.HandleDeviceControl)
	http.HandleFunc("/device/debug", device.HandleDeviceDebug)
	http.HandleFunc("/device/ctl", device.HandleDeviceCtl)
}
